#!/usr/bin/python3
from transaction import *
import promotion
import starbuzz
items= ["doubt","latte","filter","muffin"]
prices=[1.5,2.0,1.8,1.2]
running=True

while running:
    option=1
    for choice in items:
        print(str(option) + ". " +choice)
        option=option+1
    print(str(option) + ". Quit")
    choice=int(input("Choose an option: "))
    if choice==option:
        running=False
    else:
        credit_card=input("Credit card number: ")
        new_price=promotion.discount(prices[choice-1])
        hasstar=input("Has a starbuzz discount card?: ")
        if hasstar == 'y':
            new_price=starbuzz.discount(new_price)
        save_transaction(new_price,credit_card,items[choice-1])
